
#include "ObjHeader.h"
#include "Class.h"
#include "vm.h"

DEFINE_BUFFER_METHOD(Value)

void ObjHeader::InitObjHeader(VM *vm, ObjHeader *objHeader, ObjType objType, Class *objClass) {
    objHeader->type = objType;
    objHeader->isDark = false;
    objHeader->objClass = objClass;    //设置meta类
    objHeader->next = vm->allObjects;
    vm->allObjects = objHeader;
}

ObjHeader::ObjHeader(VM *vm, ObjType objType, Class *objClass) {
    this->type = objType;
    this->isDark = false;
    this->objClass = objClass;    //设置meta类
    this->next = vm->allObjects;
    vm->allObjects = this;
}

ObjHeader::ObjHeader() {

}
